package com.stefanini.pe.bbva.bp.in.converter;

import java.util.HashMap;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;

@FacesConverter(value="seccionPreguntasConverter")
public class SeccionPreguntasConverter extends SelectItemsBaseConverter{
	@Override
	public String getAsString(FacesContext arg0, UIComponent arg1, Object value)
			throws ConverterException {
		
		if (value == null || !(value instanceof HashMap)) {
			return null;
		}
		
		if(((HashMap)value).get("label") == null){
			return "";
		}else{
			return ((HashMap)value).get("label").toString();
		}
	}
}
